package com.hyl.domain.trade.adapter.repository;

import com.hyl.domain.trade.model.aggregate.GroupBuyOrderAggregate;
import com.hyl.domain.trade.model.aggregate.GroupBuyTeamSettlementAggregate;
import com.hyl.domain.trade.model.entity.*;
import com.hyl.domain.trade.model.valobj.GroupBuyProgressVO;

import java.util.List;

/**
 * @author hyl
 * @description 数据库操作
 * @create 2025-07-02 10:52
 */
public interface ITradeRepository {

    MarketPayOrderEntity queryNoPayMarketPayOrderByOutTradeNo(String userId, String outTradeNo);

    MarketPayOrderEntity lockMarketPayOrder(GroupBuyOrderAggregate groupBuyOrderAggregate);

    GroupBuyProgressVO queryGroupBuyProgress(String teamId);

//查询拼团的次数
    Integer queryOrderCountByActivityId(Long activityId, String userId);
//查询拼团活动
    GroupBuyActivityEntity queryGroupBuyActivityEntityByActivityId(Long activityId);
    //查询拼团信息
    MarketPayOrderEntity queryMarketPayOrderEntityByOutTradeNo(String userId, String outTradeNo);
    //查询组团信息
    GroupBuyTeamEntity queryGroupBuyTeamByTeamId(String teamId);
    //拼团交易试算
    NotifyTaskEntity settlementMarketPayOrder(GroupBuyTeamSettlementAggregate groupBuyTeamSettlementAggregate);
   //判断是否在sc黑名单拦截
    boolean isSCBlackIntercept(String source, String channel);

    List<NotifyTaskEntity> queryUnExecutedNotifyTaskList();

    List<NotifyTaskEntity> queryUnExecutedNotifyTaskList(String teamId);

    int updateNotifyTaskStatusSuccess(String teamId);

    int updateNotifyTaskStatusError(String teamId);

    int updateNotifyTaskStatusRetry(String teamId);
}
